<?
$comments = HDServices::activityServices()->topComments(array('type' => $type));

$route = 'bai-giang-chi-tiet';
$title = 'bài giảng';
$field = 'lesson_id';
switch ($type) {
    case 'video':
        $route = 'video-detail';
        $title = 'video';
        $field = 'video_id';
        break;
    case 'lyric':
        $route = 'chi-tiet-hop-am';
        $title = 'hợp âm';
        break;
    default:
        break;
}
?>
<div class="title-box-cmt">
    Bình luận gần đây
</div>
<div class="ct-box-cmt">
    <ul>
        @forelse($comments as $comment)

        <li class="items1 borderE9 PdTB7">
            <div class="thumb_1">
                <a href="#">
                    <img src="../images/avatar1.jpg" alt="">
                </a>
            </div>
            <div class="ct_1">
                <a href="{{ route('thanh-vien',array('id'=>$comment->user_id,'slug'=>Str::slug($comment->username)))}}"
                   class="font-Bold font12 colorDackG">
                    {{$comment->username}}
                </a>
                <span class="font12 color99">Bình luận {{$title}}</span>
                <a href="<?=route($route,array('id'=>$comment->{$field},'slug'=>$comment->slug))?>" class="color66 font12 colorDackG">
                    {{$comment->title}}
                </a>
                <span class="font12 color99">{{$comment->created_at->diffForHumans()}}</span>

                <div class="font12">{{strip_tags($comment->content)}}</div>
            </div>
        </li>
        @empty
        @endforelse
    </ul>
</div>